package com.competitions.easydubbing.dao;

import com.competitions.easydubbing.entity.Video;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author Mapler
 * @since 2021-5-20
 */
@Repository
public interface CommunityDao {

    void insertVideo(
            @Param("uid")int uid,
            @Param("title")String title,
            @Param("desc")String desc,
            @Param("url")String url,
            @Param("cover")String cover,
            @Param("channel")String channel

    );


    void deleteVideo(@Param("vid")int vid);

    void updatePlay(@Param("vid")int vid);

    void updateFavor(@Param("vid")int vid,@Param("type")int type);

    void updateComment(@Param("vid")int vid);

    void updateApplaud(@Param("vid")int vid,@Param("type")int type);

    void insertComment(@Param("vid")int vid,@Param("uid")int uid,@Param("comment")String comment);

    void insertNum(@Param("vid")int vid,@Param("uid")int uid,@Param("type")int type);

    void deleteNum(@Param("vid")int vid,@Param("uid")int uid,@Param("type")int type);

    List<Map<String,Object>> selectVideos(@Param("uid")int uid);

    List<Map<String,Object>> selectComments(@Param("vid")int vid);

    List<Video> selectVideosHistory(@Param("uid")int uid);

    Video selectVideo(@Param("vid")int vid);
}
